<HTML>
<HEAD>
<TITLE>[Chapter 22] IndexColorModel</TITLE>
<META NAME="author" CONTENT="John Zukowski">
<META NAME="date" CONTENT="Thu Jul 31 15:25:28 1997">
<META NAME="form" CONTENT="html">
<META NAME="metadata" CONTENT="dublincore.0.1">
<META NAME="objecttype" CONTENT="book part">
<META NAME="otheragent" CONTENT="gmat dbtohtml">
<META NAME="publisher" CONTENT="O'Reilly &amp; Associates, Inc.">
<META NAME="source" CONTENT="SGML">
<META NAME="subject" CONTENT="Java AWT">
<META NAME="title" CONTENT="Java AWT">
<META HTTP-EQUIV="Content-Script-Type" CONTENT="text/javascript">
</HEAD>
<body vlink="#551a8b" alink="#ff0000" text="#000000" bgcolor="#FFFFFF" link="#0000ee">

<DIV CLASS=htmlnav>
<H1><a href='index.htm'><IMG SRC="gifs/smbanner.gif"
     ALT="Java AWT" border=0></a></H1>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch22_09.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><B><FONT FACE="ARIEL,HELVETICA,HELV,SANSERIF" SIZE="-1">Chapter 22<br>java.awt.image Reference</FONT></B></TD>
<td width=172 align=right valign=top><A HREF="ch22_11.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
</table>

&nbsp;
<hr align=left width=515>
</DIV>
<DIV CLASS=refnamediv>
<H1>IndexColorModel</H1>

<H2>Name</H2>

IndexColorModel

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch22-REFSECT1-AUTOID.57"></A></h2>
</DIV>


<p>
<img align=middle src="./figs/indexco.gif" alt="[Graphic: Figure from the text]" width=503 height=53 border=0>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch22-REFSECT1-AUTOID.58">Description</A></h2>

<P CLASS=para>
The <tt CLASS=literal>IndexColorModel</tt> class is 
a <tt CLASS=literal>ColorModel</tt> that uses a color 
map lookup table (with a maximum size of 256) to convert pixel values into 
their alpha, red, green, and blue component parts. 

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch22-REFSECT1-AUTOID.59">Class Definition</A></h2>

<DIV CLASS=screen>
<P>
<PRE>
public class java.awt.image.IndexColorModel
    extends java.awt.image.ColorModel {
  // Constructors
  public IndexColorModel (int bits, int size, 
      byte[] colorMap, int start, boolean hasalpha);
  public IndexColorModel (int bits, int size, 
      byte[] colorMap, int start, boolean hasalpha, int transparent);
  public IndexColorModel (int bits, int size, 
      byte[] red, byte[] green, byte[] blue);
  public IndexColorModel (int bits, int size, 
      byte[] red, byte[] green, byte[] blue, byte[] alpha);
  public IndexColorModel (int bits, int size, 
      byte[] red, byte[] green, byte[] blue, int transparent);
  // Instance Methods
  public final int getAlpha (int pixel);
  public final void getAlphas (byte[] alphas);
  public final int getBlue (int pixel);
  public final void getBlues (byte[] blues);
  public final int getGreen (int pixel);
  public final void getGreens (byte[] greens);
  public final int getMapSize();
  public final int getRed (int pixel);
  public final void getReds (byte[] reds);
  public final int getRGB (int pixel);
  public final int getTransparentPixel();
}
</PRE>
</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch22-REFSECT1-AUTOID.60">Constructors</A></h2>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch22-REFSECT2-AUTOID.74">IndexColorModel</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch22-REFSECT3-AUTOID.79">public IndexColorModel (int bits, int size, byte[] colorMap, int start, boolean hasalpha)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>bits</I><br>
<DD>

<P CLASS=para>
The number of bits in a pixel.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>size</I><br>
<DD>

<P CLASS=para>
The number of entries in the color map. Note: this 
is not the size of the <tt CLASS=literal>colorMap</tt> 
parameter.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>colorMap</I><br>
<DD>

<P CLASS=para>
Color component values in red, green, blue, alpha order; 
the alpha component is optional, and may not be present.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>start</I><br>
<DD>

<P CLASS=para>
The starting position in <tt CLASS=literal>colorMap</tt> 
array.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>hasalpha</I><br>
<DD>

<P CLASS=para>
If <tt CLASS=literal>hasalpha</tt> 
is <tt CLASS=literal>true</tt>, alpha components are present in <tt CLASS=literal>colorMap</tt> 
array. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>ArrayIndexOutOfBoundsException</tt><br>
<DD>

<P CLASS=para>
If 
<tt CLASS=literal>size</tt> is invalid. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Constructs an <tt CLASS=literal>IndexColorModel</tt> 
object with the given component settings. The size of <tt CLASS=literal>colorMap</tt> 
must be at least <tt CLASS=literal>3*size+start</tt>, 
if <tt CLASS=literal>hasalpha</tt> is <tt CLASS=literal>false</tt>; if <tt CLASS=literal>hasalpha</tt> 
is <tt CLASS=literal>true</tt>, <tt CLASS=literal>colorMap.length</tt> must 
be at least <tt CLASS=literal>4*size+start</tt>. </DL>
</DIV>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch22-REFSECT3-AUTOID.80">public IndexColorModel (int bits, int size, byte[] colorMap, int start, boolean hasalpha, int transparent)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>bits</I><br>
<DD>

<P CLASS=para>
The number of bits in a pixel.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>size</I><br>
<DD>

<P CLASS=para>
The number of entries in the color map. Note: this 
is not the size of the <tt CLASS=literal>colorMap</tt> 
parameter.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>colorMap</I><br>
<DD>

<P CLASS=para>
Color component values in red, green, blue, alpha order; 
the alpha component is optional, and may not be present.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>start</I><br>
<DD>

<P CLASS=para>
The starting position in <tt CLASS=literal>colorMap</tt> 
array.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>hasalpha</I><br>
<DD>

<P CLASS=para>
If <tt CLASS=literal>hasalpha</tt> 
is <tt CLASS=literal>true</tt>, alpha components are present in <tt CLASS=literal>colorMap</tt> 
array.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>transparent</I><br>
<DD>

<P CLASS=para>
Position of <tt CLASS=literal>colorMap</tt> 
entry for transparent pixel entry. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>ArrayIndexOutOfBoundsException</tt><br>
<DD>

<P CLASS=para>
If 
<tt CLASS=literal>size</tt> invalid. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Constructs an <tt CLASS=literal>IndexColorModel</tt> 
object with the given component settings. The size of <tt CLASS=literal>colorMap</tt> 
must be at least <tt CLASS=literal>3*size+start</tt>, 
if <tt CLASS=literal>hasalpha</tt> is <tt CLASS=literal>false</tt>; if <tt CLASS=literal>hasalpha</tt> 
is <tt CLASS=literal>true</tt>, <tt CLASS=literal>colorMap.length</tt> must 
be at least <tt CLASS=literal>4*size+start</tt>. The 
color map has a transparent pixel; its location is given by <tt CLASS=literal>transparent</tt>. </DL>
</DIV>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch22-REFSECT3-AUTOID.81">public IndexColorModel (int bits, int size, byte[] red, byte[] green, byte[] blue)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>bits</I><br>
<DD>

<P CLASS=para>
The number of bits in a pixel.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>size</I><br>
<DD>

<P CLASS=para>
The number of entries in the color map.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>red</I><br>
<DD>

<P CLASS=para>
Red color component values.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>green</I><br>
<DD>

<P CLASS=para>
Green color component values.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>blue</I><br>
<DD>

<P CLASS=para>
Blue color component values. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>ArrayIndexOutOfBoundsException</tt><br>
<DD>

<P CLASS=para>
If 
<tt CLASS=literal>size</tt> invalid. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Constructs an <tt CLASS=literal>IndexColorModel</tt> 
object with the given component settings. There is no alpha component. 
The length of the <tt CLASS=literal>red</tt>, <tt CLASS=literal>green</tt>, 
and <tt CLASS=literal>blue</tt> arrays must be greater 
than <tt CLASS=literal>size</tt>. </DL>
</DIV>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch22-REFSECT3-AUTOID.82">public IndexColorModel (int bits, int size, byte[] red, byte[] green, byte[] blue, byte[] alpha)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>bits</I><br>
<DD>

<P CLASS=para>
The number of bits in a pixel.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>size</I><br>
<DD>

<P CLASS=para>
The number of entries in the color map.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>red</I><br>
<DD>

<P CLASS=para>
Red color component values.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>green</I><br>
<DD>

<P CLASS=para>
Green color component values.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>blue</I><br>
<DD>

<P CLASS=para>
Blue color component values.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>alpha</I><br>
<DD>

<P CLASS=para>
Alpha component values. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>ArrayIndexOutOfBoundsException</tt><br>
<DD>

<P CLASS=para>
If 
<tt CLASS=literal>size</tt> is invalid.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>NullPointerException</tt><br>
<DD>

<P CLASS=para>
If 
<tt CLASS=literal>size</tt> is positive and <tt CLASS=literal>alpha</tt> 
array is <tt CLASS=literal>null</tt>. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Constructs an <tt CLASS=literal>IndexColorModel</tt> 
object with the given component settings. The length of the <tt CLASS=literal>red</tt>, 
<tt CLASS=literal>green</tt>, <tt CLASS=literal>blue</tt>, 
and <tt CLASS=literal>alpha</tt> arrays must be greater 
than <tt CLASS=literal>size</tt>. </DL>
</DIV>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch22-REFSECT3-AUTOID.83">public IndexColorModel (int bits, int size, byte[] red, byte[] green, byte[] blue, int transparent)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>bits</I><br>
<DD>

<P CLASS=para>
The number of bits in a pixel.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>size</I><br>
<DD>

<P CLASS=para>
The number of entries in the color map.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>red</I><br>
<DD>

<P CLASS=para>
Red color component values.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>green</I><br>
<DD>

<P CLASS=para>
Green color component values.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>blue</I><br>
<DD>

<P CLASS=para>
Blue color component values.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>transparent</I><br>
<DD>

<P CLASS=para>
Position of transparent pixel entry. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>ArrayIndexOutOfBoundsException</tt><br>
<DD>

<P CLASS=para>
If 
<tt CLASS=literal>size</tt> is invalid. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Constructs an <tt CLASS=literal>IndexColorModel</tt> 
object with the given component settings. The length of the <tt CLASS=literal>red</tt>, 
<tt CLASS=literal>green</tt>, <tt CLASS=literal>blue</tt>, 
and <tt CLASS=literal>alpha</tt> arrays must be greater 
than <tt CLASS=literal>size</tt>. The color map has 
a transparent pixel; its location is given by <tt CLASS=literal>transparent</tt>. </DL>
</DIV>

</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch22-REFSECT1-AUTOID.61">Instance Methods</A></h2>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch22-REFSECT2-AUTOID.75">getAlpha</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch22-REFSECT3-AUTOID.84">public final int getAlpha (int pixel)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>pixel</I><br>
<DD>

<P CLASS=para>
A pixel encoded with this <tt CLASS=literal>ColorModel</tt>. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The current alpha setting of the pixel. 

<p>
<DT CLASS=varlistentry>Overrides<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>ColorModel.getAlpha(</tt><tt CLASS=literal>int</tt><tt CLASS=literal>)</tt> </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch22-REFSECT2-AUTOID.76">getAlphas</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch22-REFSECT3-AUTOID.85">public final void getAlphas (byte[] alphas)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>alphas</I><br>
<DD>

<P CLASS=para>
The alpha values of the pixels in the color model. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Copies the alpha values from the color map into the array <tt CLASS=literal>alphas[]</tt>. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch22-REFSECT2-AUTOID.77">getBlue</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch22-REFSECT3-AUTOID.86">public final int getBlue (int pixel)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>pixel</I><br>
<DD>

<P CLASS=para>
A pixel encoded with this <tt CLASS=literal>ColorModel</tt>. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The current blue setting of the pixel. 

<p>
<DT CLASS=varlistentry>Overrides<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>ColorModel.getBlue(</tt><tt CLASS=literal>int</tt><tt CLASS=literal>)</tt> </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch22-REFSECT2-AUTOID.78">getBlues</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch22-REFSECT3-AUTOID.87">public final void getBlues (byte[] blues)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>blues</I><br>
<DD>

<P CLASS=para>
The blue values of the pixels in the color model. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Copies the blue values from the color map into the array <tt CLASS=literal>blues[]</tt>. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch22-REFSECT2-AUTOID.79">getGreen</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch22-REFSECT3-AUTOID.88">public final int getGreen (int pixel)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>pixel</I><br>
<DD>

<P CLASS=para>
A pixel encoded with this <tt CLASS=literal>ColorModel</tt>. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The current green setting of the pixel. 

<p>
<DT CLASS=varlistentry>Overrides<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>ColorModel.getGreen(</tt><tt CLASS=literal>int</tt><tt CLASS=literal>)</tt> </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch22-REFSECT2-AUTOID.80">getGreens</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch22-REFSECT3-AUTOID.89">public final void getGreens (byte[] greens)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>greens</I><br>
<DD>

<P CLASS=para>
The green values of the pixels in the color model. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Copies the green values from the color map into the array <tt CLASS=literal>greens[]</tt>. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch22-REFSECT2-AUTOID.81">getMapSize</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch22-REFSECT3-AUTOID.90">public final int getMapSize()</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The current size of the color map table. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch22-REFSECT2-AUTOID.82">getRed</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch22-REFSECT3-AUTOID.91">public final int getRed (int pixel)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>pixel</I><br>
<DD>

<P CLASS=para>
A pixel encoded with this <tt CLASS=literal>ColorModel</tt>. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The current red setting of the pixel. 

<p>
<DT CLASS=varlistentry>Overrides<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>ColorModel.getRed(</tt><tt CLASS=literal>int</tt><tt CLASS=literal>)</tt> </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch22-REFSECT2-AUTOID.83">getReds</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch22-REFSECT3-AUTOID.92">public final void getReds (byte[] reds)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>reds</I><br>
<DD>

<P CLASS=para>
The red values of the pixels in the color model. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Copies the red values from the color map into the array <tt CLASS=literal>reds[]</tt>. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch22-REFSECT2-AUTOID.84">getRGB</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch22-REFSECT3-AUTOID.93">public final int getRGB (int pixel)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>pixel</I><br>
<DD>

<P CLASS=para>
A pixel encoded with this <tt CLASS=literal>ColorModel</tt>. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The current combined red, green, and blue settings of the pixel. 

<p>
<DT CLASS=varlistentry>Overrides<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>ColorModel.getRGB(</tt><tt CLASS=literal>int</tt><tt CLASS=literal>)</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Gets the color of <tt CLASS=literal>pixel</tt> in the default RGB color model. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch22-REFSECT2-AUTOID.85">getTransparentPixel</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch22-REFSECT3-AUTOID.94">public final int getTransparentPixel()</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The array index for the transparent pixel in the color model. </DL>
</DIV>

</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch22-REFSECT1-AUTOID.62">See Also</A></h2>

<P CLASS=para>
<tt CLASS=literal>ColorModel</tt> 

</DIV>


<DIV CLASS=htmlnav>

<P>
<HR align=left width=515>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch22_09.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><a href="index.htm"><img src='gifs/txthome.gif' border=0 alt='Home'></a></td>
<td width=172 align=right valign=top><A HREF="ch22_11.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
<tr>
<td width=172 align=left valign=top>ImageProducer</td>
<td width=171 align=center valign=top><a href="index/idx_a.htm"><img src='gifs/index.gif' alt='Book Index' border=0></a></td>
<td width=172 align=right valign=top>MemoryImageSource</td>
</tr>
</table>
<hr align=left width=515>

<IMG SRC="gifs/smnavbar.gif" USEMAP="#map" BORDER=0> 
<MAP NAME="map"> 
<AREA SHAPE=RECT COORDS="0,0,108,15" HREF="../javanut/index.htm"
alt="Java in a Nutshell"> 
<AREA SHAPE=RECT COORDS="109,0,200,15" HREF="../langref/index.htm" 
alt="Java Language Reference"> 
<AREA SHAPE=RECT COORDS="203,0,290,15" HREF="../awt/index.htm" 
alt="Java AWT"> 
<AREA SHAPE=RECT COORDS="291,0,419,15" HREF="../fclass/index.htm" 
alt="Java Fundamental Classes"> 
<AREA SHAPE=RECT COORDS="421,0,514,15" HREF="../exp/index.htm" 
alt="Exploring Java"> 
</MAP>
</DIV>

</BODY>
</HTML>
